home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / Visual Foxpro 6.0 (Ent. Edition) / Vf6ent Extractor.EXE / TOOLS / XSOURCE / XSOURCE.ZIP / vfpsource / wizards / Wzcommon / click.prg next >
Encoding:
Text File  |  1998-05-01  |  1.3 KB  |  47 lines

  1. #define C_DEBUG .t.
  2.  
  3. * The following string is used to form a message when 
  4. * _LOGFILE cannot be created or opened. The message will
  5. * look like one of these two examples:
  6. *
  7. *    FCREATE("test1.log") failed. Event logging disabled.
  8. *    FOPEN("test1.log", 2) failed. Event logging disabled.
  9.  
  10. #define LOGFILEERROR_LOC    " failed. Event logging disabled."
  11.  
  12. #IF C_DEBUG
  13.     if type('_logfile') = 'C' .and. !empty(_logfile)
  14.         private iHandle, oObjRef, cName
  15.         
  16.         oObjRef = this
  17.         cName = this.Name
  18.         do while type('oObjRef.Parent') = 'O'
  19.             cName = oObjRef.Parent.Name + '.' + cName
  20.             oObjRef = oObjRef.Parent
  21.             if !type('oObjRef.Parent') = 'O'
  22.                 * We're at the top--use the oWizard variable instead
  23.                 * of the Name and exit
  24.                 m.cName = 'oWizard.'+m.cName
  25.                 exit
  26.             endif
  27.         enddo
  28.  
  29.         if !file(_logfile)
  30.             m.iHandle = fcreate(_logfile)
  31.         else
  32.             m.iHandle = fopen(_logfile, 2)
  33.         endif
  34.         if m.iHandle = -1
  35.             =MessageBox(iif(!file(_logfile), 'FCREATE("', 'FOPEN("') + ;
  36.                 _logfile + iif(!file(_logfile), '") ', '", 2)') + ;
  37.                 LOGFILEERROR_LOC)
  38.             release _logfile
  39.         else
  40.             =fseek(m.iHandle, 0, 2) && go to EOF
  41.             =fputs(m.iHandle, ;
  42.                 'DO COMMCLIK WITH "' + m.cName + '", "' + thisform.Name + '"')
  43.             =fclose(m.iHandle)
  44.         endif
  45.     endif
  46. #ENDIF
  47.